home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 001-025 / disk_003 / cforth / l2b.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  674b  |  29 lines

  1. /* usage: line2block < linefile > blockfile
  2.  * takes a file (like one generated by block2line) of the form:
  3.  *    <header line>
  4.  *    < 16 screen lines >
  5.  *    ...
  6.  * and produces a block file with exactly 64 characters on each line, having
  7.  * removed the header lines. This file is suitable for use with FORTH as a
  8.  * block file.
  9.  */
  10.  
  11. #include <stdio.h>
  12.  
  13. main()
  14. {
  15.     int i;
  16.     char buf[65];
  17.     char *spaces =    /* 64 spaces, below */
  18.     "                                                                ";
  19.             /* 64 spaces, above */
  20.     while (1) {
  21.         gets(buf);            /* header line */
  22.         for (i=0; i<16; i++) {
  23.             if (gets(buf) == NULL) exit(0);
  24.             printf("%s%s",buf,spaces+strlen(buf));
  25.         }
  26.     }
  27. }
  28.             
  29.